<?php if (!empty($Partners)) echo "<h1>" . $Partners[0]['Company']['razon_social'] . "</h1>" ?>
<div class="paging">
    <?php
    echo $this->Paginator->options(array('update' => '#content', 'evalScripts' => false));
    echo $this->Paginator->prev('< ' . __('Anterior'), array(), null, array('class' => 'prev disabled'));
    echo $this->Paginator->numbers(array('separator' => ''));
    echo $this->Paginator->next(__('Siguiente') . ' >', array(), null, array('class' => 'next disabled'));
    ?>
</div>
<table class="table">
    <thead>
        <tr>
            <th><?php echo $this->Paginator->sort('Partner.id', 'Id '); ?></th>
            <th><?php echo $this->Paginator->sort('Partner.n_ficha', 'Número ficha'); ?></th>
            <th><?php echo $this->Paginator->sort('Partner.t_identificacion', 'Tipo identificación'); ?></th>
            <th><?php echo $this->Paginator->sort('Partner.n_identificacion', 'Número de identificación'); ?></th>
            <th><?php echo $this->Paginator->sort('Partner.nombres_apellidos', 'Nombre'); ?></th>
            <th></th>
            <th></th>
            <th></th>
        </tr>
    </thead>
    <tbody>
        <?php foreach ($Partners as $Partner): ?>
            <tr>
                <td><?php echo $Partner['Partner']['id']; ?></td>
                <td><?php echo $Partner['Partner']['n_ficha']; ?></td>
                <td><?php echo $Partner['Partner']['t_identificacion']; ?></td>
                <td><?php echo $Partner['Partner']['n_identificacion']; ?></td>
                <td><?php echo $Partner['Partner']['nombres_apellidos']; ?></td>
                <td>

                    <?php
                    if (file_exists("../webroot/files/Empresa-" . $company_id . "/" .$Partner['Partner']['adjunto_encuesta']) and $Partner['Partner']['adjunto_encuesta'] != "")
                        echo $this->Html->link('Encuesta pdf', "../files/Empresa-" . $company_id . "/" . $Partner['Partner']['adjunto_encuesta'], array('target' => 'blank', 'indicator' => 'loading', 'class' => 'acciones'));
                    ?>
                </td>
                <td><?php echo $this->Ajax->link('Editar', array('controller' => 'Partners', 'action' => 'edit', $Partner["Partner"]["id"]), array('update' => 'content', 'indicator' => 'loading', 'class' => 'acciones')); ?></td>
                <td><?php echo $this->Ajax->link('Eliminar', array('controller' => 'Partners', 'action' => 'delete', $Partner["Partner"]["id"], $company_id), array('update' => 'content', 'indicator' => 'loading', 'class' => 'acciones'), '¿Desea borrar el registro?'); ?></td>
            </tr>
        <?php endforeach; ?>
    </tbody>
</table>
<?php echo $this->Js->writeBuffer(); ?>
<?php echo $this->Ajax->link('Adicionar', array('controller' => 'Partners', 'action' => 'add', $company_id), array('update' => 'content', 'indicator' => 'loading', 'class' => 'aciones', 'class' => 'acciones')); ?>
<table width="100%" border="0"  CellSpacing=10  align="center" >
    <tbody>
        <tr>          
            <td><?php echo $this->Ajax->link($this->Html->image('regresar.gif', array('width' => '30', 'heigth' => '30', 'alt' => 'Regresar', 'title' => 'Regresar')), array('controller' => 'Companies', 'action' => 'index',$company_id), array('update' => 'content', 'indicator' => 'loading', 'escape' => false)); ?></td>
        </tr>
    </tbody>
</table>